#ifndef PRINT_H
#define PRINT_H
#include "nodes/nodes.h"
#include "nodes/parse_nodes.h"

#define NOTICE	0	/* random info - no special action */
#define WARN	-1	/* Warning error - return to known state */
#define FATAL	1	/* Fatal error - abort process */
#define DEBUG	-2	/* debug message */
#define NOIND	-3	/* debug message, don't indent as far */

#define PTIME	0x100	/* prepend time to message */
#define POS	0x200	/* prepend source position to message */
#define USERMSG	0x400	/* send message to user */
#define TERM	0x800	/* send message to terminal */
#define DBLOG	0x1000	/* put message in per db log */
#define SLOG	0x2000	/* put message in system log */
#define ABORT	0x4000	/* abort process after logging */

#define ELOG_MAXLEN 4096

void elog(int lev, char *fmt, ...);
char *node_to_string(void *op);
void print(void *obj);
void string_to_node(char *str);
void copy_object(void *obj);
void _out_node(string_info_t str, void *obj);
void append_string_info(string_info_t str, char *buffer);
void _out_query(string_info_t str, query_t *node);
void _out_expr(string_info_t str, expr_t *node);
void _out_var(string_info_t str, var_t *node);
void _out_oper(string_info_t str, oper_t *node);
void _out_target_entry(string_info_t str, target_entry_t *node);
void _out_range_tbl_entry(string_info_t str, range_tbl_entry_t *node);
void _out_value(string_info_t str, parse_value_t *value);
void _out_resdom(string_info_t str, resdom_t *node);
#endif
